<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router'
import { watch } from 'vue'

const route = useRoute()
const router = useRouter()
const toPath = (path: string) => {
  console.log(route, path);
  router.push(route.path)
};

</script>

<template>
  <div>
    <!-- <div style="display: flex; gap: 10px;">
      <div @click="toPath('/')">子应用页面1</div>
      <div @click="toPath('/app2')">子应用页面2</div>
    </div> -->
    <router-link to="/app1">子应用页面1</router-link>
    <router-link to="/app2">子应用页面2</router-link>
    <router-view></router-view>
  </div>
</template>

<style lang="scss" scoped></style>
